package com.vf.admin.client.dao;

import com.vf.admin.common.db.BaseDao;
import com.vf.admin.miaodong.entity.AppFamilyIdentity;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Repository
public class AppFamilyIdentityDao extends BaseDao<AppFamilyIdentity> {

    public List<AppFamilyIdentity> getIdentityList(Integer type)
    {
        List<Object> paramList = new ArrayList<>();
        StringBuilder stringBuilder = new StringBuilder();
        if(type == 1){
            stringBuilder.append("select * from app_family_identity order by sort asc");
        }else if(type == 2)
        {
            stringBuilder.append("select * from app_family_identity where id!=1 order by sort asc");
        }
        String sql = stringBuilder.toString();
        return this.queryList(sql,paramList,AppFamilyIdentity.class);
    }

    public AppFamilyIdentity getIdentity(Integer id)
    {
        ArrayList<Object> list = new ArrayList<>();
        String sql = "select * from app_family_identity where id=?";
        list.add(id);
        return this.queryObj(sql,list,AppFamilyIdentity.class);
    }


}
